home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PROGEDIT / 3458A.ZIP / AMAC44A.ZIP / DAT002.QM < prev    next >
Text File  |  1992-05-27  |  11KB  |  221 lines

  1. *                               dat002.qm
  2. *                        Written By Tom Hogshead
  3. *                       [ See DATExx.QM For Use ]
  4. *                                 5/12/92
  5. *                                                                      Bytes
  6. *  Key       Subfile                   Description/Output           Small Fast
  7. * =====  ===============  ========================================== ==== ====
  8. * @(f5)                   Thursday, April 9, 1992 at 11:18 am         137
  9. * @(f6)                   |                                                862
  10. *                                                                       
  11. *          {e:\up\DATE*}--Return To DATExx.QM                         BEST
  12. *
  13. *-- eoi
  14.  
  15. *                          M A C R O S
  16. * ---------------------------------------------------------------------
  17. * @(f5) Date and Time in English "Thursday, April 9, 1992 at 11:18 am",
  18. *       Requires Data Files $date And $time, Small
  19. * ---------------------------------------------------------------------*
  20. *   The data files $date and $time must exist in the current directory
  21. *   or change "d:\path\" to your path containing these files to
  22. *   execute in any directory.  Files $date and $time contain:
  23. *   ┌──────────────────────────────────────────────────────────────────┐
  24. *   │$date                                                             │
  25. *   │Mon Monday    Tue Tuesday  Wed Wednesday  Thu Thursday  Fri Friday│
  26. *   │Sat Saturday  Sun Sunday   01 January     02 February   03 March  │
  27. *   │04 April      05 May       06 June        07 July       08 August │
  28. *   │09 September  10 October   11 November    12 December             │
  29. *   └──────────────────────────────────────────────────────────────────┘
  30. *
  31. *   ┌─────────────────────────────────────────────────────────────────────┐
  32. *   │$time                                                                │
  33. *   │01 1 am 02  2 am 03  3 am 04  4 am 05 5 am 06  6 am 07  7 am 08  8 am│
  34. *   │09 9 am 10 10 am 11 11 am 12 12 pm 13 1 pm 14  2 pm 15  3 pm 16  4 pm│
  35. *   │17 5 pm 18  6 pm 19  7 pm 20  8 pm 21 9 pm 22 10 pm 23 11 pm 00 12 am│
  36. *   └─────────────────────────────────────────────────────────────────────┘
  37.  
  38. @f5     macrobegin
  39. * === Insert Date Tuesday, April 14, 1992 at 3:28 pm, From @2 DATE*.QM ===*
  40.         setscreenoff setinsmode defaultwordset insertdate
  41. * ------------------------ Remove Second Dash ------------------------*
  42.         wordleft toggleinsert backspace wordleft
  43. * ------------------ Remove Day Number Leading Zero ------------------*
  44.         unmarkblock markcolumn                      * Mark day digit 1
  45.         findreplace
  46.             "0" return delline return "ln" return   * Remove leading zero
  47. * ------------------------ Remove First Dash ------------------------*
  48.         backspace wordleft wordleft toggleinsert
  49. * ------------------------- Expand Day Name -------------------------*
  50.         markword cut onewindow horizontalwindow
  51.         editfile
  52. *           "d:\path\"              * Change to your path for "$date"
  53.             "$date" return
  54.         find paste return delline return
  55.         wordright markword copy prevwindow paste
  56. * ------------------- Insert Comma After Day Name -------------------*
  57.         gotoblockend "," delch
  58. * ------------------ Replace Month Number with Name ------------------*
  59.         wordright markword cut nextwindow
  60.         find paste return delline return
  61.         wordright markword copy
  62.         quit prevwindow onewindow paste
  63. * ------------------ Insert Comma After Day Number ------------------*
  64.         gotoblockend wordright markword gotoblockend "," wordright
  65.         markword gotoblockend cursorright * unmarkblock
  66.         "at" cursorright
  67. * ========= Insert Time In 3:27 pm Format, From @3 dat002.qm =========*
  68.         splitline
  69.         inserttime delltword delltword delltword    * Delete ":secs "
  70.         wordleft wordleft markword cut              * Cut 24 hour # to scrap
  71.         onewindow horizontalwindow                  * Setup window for $time
  72.         editfile
  73. *           "d:\path\"              * Change to your path for "$time"
  74.             "$time" return
  75.         find paste return delline return            * Find 24 hour #
  76.         wordright markcolumn wordright cursorright  * Mark 12 hour and am/pm
  77.         copy quit prevwindow onewindow paste        * Copy/quit/paste data
  78.         wordright markword cursorleft markcolumn    * Mark " am/pm"
  79.         endline moveblock                           * Move it where it belongs
  80.         endline cursorright joinline unmarkblock    * Clean up and pos cursor
  81. *
  82. * 137 bytes Tue  04-14-1992  22:52:27 (TH @f5)
  83. * 137 bytes Tue  05-12-1992  09:16:40 (TH @f5, changed description)
  84.  
  85. * 
  86. * ---------------------------------------------------------------------
  87. * @(f6) Date and Time in English "Thursday, April 9, 1992 at 11:18 am",
  88. *       Revision 1.2 by Mel Hulse
  89. * ---------------------------------------------------------------------*
  90. * This macro is based on the techniques used by Tim Farley and uploaded
  91. * by Patrick Pluto.
  92.  
  93. @f6 MacroBegin
  94.     setscreenoff
  95.     UnmarkBlock         * Housekeeping
  96.     DefaultWordSet      *      "
  97.     InsertDate          * Places system date at the cursor position
  98.     PrevPosition        * Goto front of date string
  99. *------ vvvv If you don't want day spelled out, DELETE FROM HERE ----*
  100.     MarkWord            * Mark the abreviated day
  101. *------ Replace Day with spelled out name within the marked block----*
  102.     FindReplace"Mon" Return "Monday, "    Return "LN" Return
  103.     FindReplace"Tue" Return "Tuesday, "   Return "LN" Return
  104.     FindReplace"Wed" Return "Wednesday, " Return "LN" Return
  105.     FindReplace"Thu" Return "Thursday, "  Return "LN" Return
  106.     FindReplace"Fri" Return "Friday, "    Return "LN" Return
  107.     FindReplace"Sat" Return "Saturday, "  Return "LN" Return
  108.     FindReplace"Sun" Return "Sunday, "    Return "LN" Return
  109.   Month:                 * Target for jump
  110. *--------------------------------------------------------------------*
  111.     GotoBlockEnd        * Goto the 2 spaces after the day
  112. *------ ^^^^ TO HERE,  ----------------------------------------------*
  113.     DelRtWord           * Delete spaces if Q is configured to...
  114.                         * delete following white space...
  115.                         * (Delete day, if your not using it)
  116.     UnmarkBlock         * Un mark
  117.     MarkWord
  118. *------ Replace Month number with Name  -----------------------------*
  119.     FindReplace"01" Return "January "   Return "LN" Return
  120.     FindReplace"02" Return "February "  Return "LN" Return
  121.     FindReplace"03" Return "March "     Return "LN" Return
  122.     FindReplace"04" Return "April "     Return "LN" Return
  123.     FindReplace"05" Return "May "       Return "LN" Return
  124.     FindReplace"06" Return "June "      Return "LN" Return
  125.     FindReplace"07" Return "July "      Return "LN" Return
  126.     FindReplace"08" Return "August "    Return "LN" Return
  127.     FindReplace"09" Return "September " Return "LN" Return
  128.     FindReplace"10" Return "October "   Return "LN" Return
  129.     FindReplace"11" Return "November "  Return "LN" Return
  130.     FindReplace"12" Return "December "  Return "LN" Return
  131.     GotoBlockEnd        * Go to the space after month
  132.     UnmarkBlock         * Un mark
  133.     Delch               * Delete hyphen
  134. *------ Remove Zero in Day Number -----------------------------------*
  135.     CursorLeft          * Ready for 2 character find...
  136.     DropAnchor          * Mark 1st...
  137.     CursorRight         * and second...
  138.     DropAnchor          * characters
  139.     GotoBlockBeg        * And go to block's start
  140.     FindReplace " 0" Return " " Return "LN" Return  * Find a "0" and delete it
  141.     GoToBlockEnd        * Go toward hyphen
  142.     UnmarkBlock         * Un mark
  143.     CursorRight         * And one character more
  144.     Delch ", "          * Delete hyphen & add comma and space
  145. *--------------------------------------------------------------------*
  146.     MarkWord            * Mark the year
  147.     GotoBlockEnd        * Go to the space after the year
  148.     UnmarkBlock         * Un mark
  149.     DelCh               * Delete 1 character at years end
  150. *------- Delete after here if time not wanted -----------------------*
  151. *   Time:  "12:36 pm ", not "12:36:18 "
  152. * -------------------------------------------------------------------*
  153.     AltWordSet          * Housekeeping - Turn back to DefaultWordSet ....
  154.     " at "
  155.     InsertTime          * Insert the time
  156.     Backspace           * Backspaces...
  157.     Backspace           * over...
  158.     Backspace           * the...
  159.     Backspace           * seconds
  160.     CursorLeft          * Go to the end of time
  161.     MarkWord            * Mark time
  162.     GotoBlockBeg        * Go to the beginning of time
  163.     UnmarkBlock         * Un mark
  164.     CursorLeft          * And 1 character before time
  165.     DropAnchor          * Mark the...
  166.     CursorRight         * 1st 2 characters...
  167.     DropAnchor          * of the hour
  168.     CursorLeft          * See if it's a "0"  and delete it
  169.     FindReplace " 0" Return " " Return "ln" Return JTrue am
  170.     GoToBlockEnd        * Otherwise, convert the hour
  171.     UnmarkBlock         * Un mark the find block
  172.     DropAnchor          * Mark...
  173.     CursorLeft          * the...
  174.     DropAnchor          * hour
  175.     CursorLeft          * Go past 1st character
  176.     *   Look for each 2 digit hour, 11 or less & go to "am"...
  177.     FindReplace "10" Return "10" Return "ln" Return JTrue am
  178.     FindReplace "11" Return "11" Return "ln" Return JTrue am
  179.     * ...or convert it to the 12 hour clock
  180.     FindReplace "13" Return "1"  Return "ln" Return
  181.     FindReplace "14" Return "2"  Return "ln" Return
  182.     FindReplace "15" Return "3"  Return "ln" Return
  183.     FindReplace "16" Return "4"  Return "ln" Return
  184.     FindReplace "17" Return "5"  Return "ln" Return
  185.     FindReplace "18" Return "6"  Return "ln" Return
  186.     FindReplace "19" Return "7"  Return "ln" Return
  187.     FindReplace "20" Return "8"  Return "ln" Return
  188.     FindReplace "21" Return "9"  Return "ln" Return
  189.     FindReplace "22" Return "10" Return "ln" Return
  190.     FindReplace "23" Return "11" Return "ln" Return
  191.     Jump pm             * ...and go to "pm"
  192.   am:                   * Target
  193.     GotoBlockEnd        * Get past time
  194.     UnmarkBlock         * Un mark the find block
  195.     MarkWord GotoBlockEnd UnmarkBlock   * Go to the end of time
  196.     " am"               * Enter "am"
  197.     Jump end            * Quit
  198.   pm:                   * Target
  199.     GotoBlockEnd        * Get past time
  200.     UnmarkBlock         * Un mark the find block
  201.     MarkWord GotoBlockEnd UnmarkBlock   * Go to the end of time
  202.     " pm"               * Enter "pm"
  203.   end:                  * Quit target
  204.     CursorRight         * Put the cursor where user wants it
  205.     DefaultWordSet      * Put it back where it probably was
  206. *
  207. * 861 bytes, Sunday, April 7, 1991 at 12:41 am
  208. * 861 bytes Thu  04-11-1991  15:59:52 check thh
  209. * 862 bytes Wed  04-08-1992  20:52:32 (TH @f6, added setscreenoff)
  210.  
  211. * Enjoy!
  212.  
  213. * » Saturday, April 6, 1991 at 11:39 pm ■ .\\É£ ╟│u£se, Silicon Valley «
  214. * ---
  215. *  ■ SLMR 1.05 #356 ■ Reward for a job well done: more work.
  216.  
  217. * PCRelay:COMPEASE -> #90 RelayNet (tm)
  218. * 4.10                *Comp-U-Ease* CA. 408-286-8332  HST/V.32/VSM
  219.  
  220. *--eof
  221.